<?
require_once("../conn.php");

//get the details

$name = $_GET[uname];

$q1 = "select * from job_seeker_info where uname = '$name' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);



if(ereg($_GET[file], $a1[image]))
{
	
	if($_GET[file] != "no.jpg")
	{
	//delete the file
	unlink("../re_images/$_GET[file]");
  }
	
	$q2 = "update job_seeker_info set image = 'no.jpg' where uname = '$name' ";
	mysql_query($q2) or die(mysql_error());
}

header("location:preview.php?uname=$name");
exit();

?>